<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="​        最近在调试算法，需要把mcu上的一个大数组全部传出来，然后在电脑上用python进行分析，但是数据量比较大，同时传输间隔又短，串口来不及传输，后来调研下来发现可以使用segger RTT实现。 ​        segger RTT的移植这边就不说了，网上一大把，主要说一下这里的思路。mcu上移植好rtt，就可以发送数据了，然后电脑端发现可以使用python调用JLink_x64">
<meta property="og:type" content="article">
<meta property="og:title" content="SeggerRtt传输大数据量">
<meta property="og:url" content="http://example.com/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="​        最近在调试算法，需要把mcu上的一个大数组全部传出来，然后在电脑上用python进行分析，但是数据量比较大，同时传输间隔又短，串口来不及传输，后来调研下来发现可以使用segger RTT实现。 ​        segger RTT的移植这边就不说了，网上一大把，主要说一下这里的思路。mcu上移植好rtt，就可以发送数据了，然后电脑端发现可以使用python调用JLink_x64">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2022-04-17T07:22:50.168Z">
<meta property="article:modified_time" content="2022-04-17T07:22:50.168Z">
<meta property="article:author" content="xudonglei">
<meta property="article:tag" content="调试工具">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://example.com/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>SeggerRtt传输大数据量 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          SeggerRtt传输大数据量
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2022-04-17 15:22:50" itemprop="dateCreated datePublished" datetime="2022-04-17T15:22:50+08:00">2022-04-17</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F/" itemprop="url" rel="index"><span itemprop="name">嵌入式</span></a>
                </span>
            </span>

          
            <span id="/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/" class="post-meta-item leancloud_visitors" data-flag-title="SeggerRtt传输大数据量" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2022/04/17/SeggerRtt%E4%BC%A0%E8%BE%93%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%87%8F/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>​        最近在调试算法，需要把mcu上的一个大数组全部传出来，然后在电脑上用python进行分析，但是数据量比较大，同时传输间隔又短，串口来不及传输，后来调研下来发现可以使用segger RTT实现。</p>
<p>​        segger RTT的移植这边就不说了，网上一大把，主要说一下这里的思路。mcu上移植好rtt，就可以发送数据了，然后电脑端发现可以使用python调用JLink_x64.dll来实现数据的接收，完美开整。</p>
<h3 id="一、MCU端"><a href="#一、MCU端" class="headerlink" title="一、MCU端"></a>一、MCU端</h3><p>​        这里主要介绍一下mcu端涉及到我们写代码需要注意的地方。</p>
<ul>
<li><strong>SEGGER_RTT_MAX_NUM_UP_BUFFERS</strong>：最大上行缓存数量，默认为3；</li>
<li><strong>SEGGER_RTT_MAX_NUM_DOWN_BUFFERS</strong>：最大下行缓存数量，默认为3；</li>
<li><strong>BUFFER_SIZE_UP</strong>：上行缓存大小，默认为1024字节</li>
<li><strong>BUFFER_SIZE_DOWN</strong>：下行缓存大小，默认为16字节</li>
<li><strong>SEGGER_RTT_PRINTF_BUFFER_SIZE</strong>：RTT printf()缓存大小，默认为64字节</li>
<li><strong>SEGGER_RTT_MODE_DEFAULT</strong>：RTT内存块工作模式</li>
</ul>
<p>​    用户可以根据自己的实际需求，对这些参数进行配置，也可以使用其默认配置工作。</p>
<p>​    其中，RTT内存块工作模式工作模式可以配置为以下三种之一：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="meta-keyword">define</span> SEGGER_RTT_MODE_NO_BLOCK_SKIP         (0)     <span class="comment">// Skip. Do not block, output nothing. (Default)</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> SEGGER_RTT_MODE_NO_BLOCK_TRIM         (1)     <span class="comment">// Trim: Do not block, output as much as fits.</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL    (2)     <span class="comment">// Block: Wait until there is space in the buffer.</span></span></span><br></pre></td></tr></table></figure>
<p>​        前面两种都是<strong>非阻塞方式</strong>，差别是写入数据长度大于当前buffer中可用空间时，是跳过不写入任何数据(<strong>SKIP</strong>)，还是写入尽量多的数据(<strong>TRIM</strong>, 比如要写入5个字节“Hello”，而当前buffer只剩2个字节空间了，则将“He”写入，而“llo”则被忽略)；</p>
<p>​        若选择<strong>SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL</strong> ，在写入数据长度大于当前buffer中可用空间时，RTT将阻塞CPU内核，等待buffer中的数据为J-LINK上位机取走，再写入。这种方式虽然可以避免数据丢失，但是在脱机运行(不连接J-LINK上位机软件)时，将会阻塞CPU运行，因此，需要特别小心。</p>
<p>​        我的工程里就故意设置成SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL，因为配合我板子上的led灯，我可以方便的看到我发送的数据是不是有丢。</p>
<p>​        还有一个我更改的配置是：#define BUFFER_SIZE_UP     (1024*40)   默认是1024，这里加大之后，数据确实来得及发送了。</p>
<h3 id="二、电脑端"><a href="#二、电脑端" class="headerlink" title="二、电脑端"></a>二、电脑端</h3><p>​        电脑端可以使用python来实现数据接收，这里搬运了网上大神写的代码，稍加修改后实测没有问题。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> ctypes</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">RingBuffer</span>(<span class="params">ctypes.Structure</span>):</span></span><br><span class="line">    _fields_ = [</span><br><span class="line">        (<span class="string">&#x27;sName&#x27;</span>, ctypes.c_uint),  <span class="comment"># ctypes.POINTER(ctypes.c_char)，64位Python中 ctypes.POINTER 是64位的，与目标芯片不符</span></span><br><span class="line">        (<span class="string">&#x27;pBuffer&#x27;</span>, ctypes.c_uint),  <span class="comment"># ctypes.POINTER(ctypes.c_byte)</span></span><br><span class="line">        (<span class="string">&#x27;SizeOfBuffer&#x27;</span>, ctypes.c_uint),</span><br><span class="line">        (<span class="string">&#x27;WrOff&#x27;</span>, ctypes.c_uint),  <span class="comment"># Position of next item to be written. 对于aUp：   芯片更新WrOff，主机更新RdOff</span></span><br><span class="line">        (<span class="string">&#x27;RdOff&#x27;</span>, ctypes.c_uint),  <span class="comment"># Position of next item to be read.    对于aDown： 主机更新WrOff，芯片更新RdOff</span></span><br><span class="line">        (<span class="string">&#x27;Flags&#x27;</span>, ctypes.c_uint),</span><br><span class="line">    ]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">SEGGER_RTT_CB</span>(<span class="params">ctypes.Structure</span>):</span>  <span class="comment"># Control Block</span></span><br><span class="line">    _fields_ = [</span><br><span class="line">        (<span class="string">&#x27;acID&#x27;</span>, ctypes.c_char * <span class="number">16</span>),</span><br><span class="line">        (<span class="string">&#x27;MaxNumUpBuffers&#x27;</span>, ctypes.c_uint),</span><br><span class="line">        (<span class="string">&#x27;MaxNumDownBuffers&#x27;</span>, ctypes.c_uint),</span><br><span class="line">        (<span class="string">&#x27;aUp&#x27;</span>, RingBuffer * <span class="number">2</span>),</span><br><span class="line">        (<span class="string">&#x27;aDown&#x27;</span>, RingBuffer * <span class="number">2</span>),</span><br><span class="line">    ]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">RTT</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span>(<span class="params">self</span>):</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">connectdevice</span>(<span class="params">self</span>):</span></span><br><span class="line">        <span class="comment"># 初始化连接上目标</span></span><br><span class="line">        self.jlink = ctypes.cdll.LoadLibrary(<span class="string">&#x27;./JLink_x64.dll&#x27;</span>)</span><br><span class="line">        err_buf = (ctypes.c_char * <span class="number">64</span>)()</span><br><span class="line">        self.jlink.JLINKARM_ExecCommand(<span class="string">f&#x27;Device = Cortex-M4&#x27;</span>.encode(<span class="string">&#x27;latin-1&#x27;</span>), err_buf, <span class="number">64</span>)</span><br><span class="line">        self.jlink.JLINKARM_TIF_Select(<span class="number">1</span>)</span><br><span class="line">        self.jlink.JLINKARM_SetSpeed(<span class="number">4000</span>)</span><br><span class="line"></span><br><span class="line">        buff = ctypes.create_string_buffer(<span class="number">1024</span>)</span><br><span class="line">        Addr = <span class="number">536870912</span>  <span class="comment"># 0x20000000</span></span><br><span class="line">        <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">128</span>):</span><br><span class="line">            self.jlink.JLINKARM_ReadMem(Addr + <span class="number">1024</span> * i, <span class="number">1024</span>, buff)</span><br><span class="line">            index = buff.raw.find(<span class="string">b&#x27;SEGGER RTT&#x27;</span>)</span><br><span class="line">            <span class="keyword">if</span> index != -<span class="number">1</span>:</span><br><span class="line">                self.RTTAddr = Addr + <span class="number">1024</span> * i + index</span><br><span class="line">                buff = ctypes.create_string_buffer(ctypes.sizeof(SEGGER_RTT_CB))</span><br><span class="line">                self.jlink.JLINKARM_ReadMem(self.RTTAddr, ctypes.sizeof(SEGGER_RTT_CB), buff)</span><br><span class="line">                rtt_cb = SEGGER_RTT_CB.from_buffer(buff)</span><br><span class="line">                self.aUpAddr = self.RTTAddr + <span class="number">16</span> + <span class="number">4</span> + <span class="number">4</span></span><br><span class="line">                self.aDownAddr = self.aUpAddr + ctypes.sizeof(RingBuffer) * rtt_cb.MaxNumUpBuffers</span><br><span class="line">                print(self.RTTAddr, rtt_cb.MaxNumUpBuffers, rtt_cb.MaxNumDownBuffers)</span><br><span class="line">                <span class="keyword">break</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">aUpRead</span>(<span class="params">self</span>):</span></span><br><span class="line">        buf = ctypes.create_string_buffer(ctypes.sizeof(RingBuffer))</span><br><span class="line">        self.jlink.JLINKARM_ReadMem(self.aUpAddr, ctypes.sizeof(RingBuffer), buf)</span><br><span class="line">        aUp = RingBuffer.from_buffer(buf)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> aUp.RdOff == aUp.WrOff:</span><br><span class="line">            <span class="built_in">str</span> = ctypes.create_string_buffer(<span class="number">0</span>)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">elif</span> aUp.RdOff &lt; aUp.WrOff:</span><br><span class="line">            cnt = aUp.WrOff - aUp.RdOff</span><br><span class="line">            <span class="built_in">str</span> = ctypes.create_string_buffer(cnt)</span><br><span class="line">            self.jlink.JLINKARM_ReadMem(ctypes.cast(aUp.pBuffer, ctypes.c_void_p).value + aUp.RdOff, cnt, <span class="built_in">str</span>)</span><br><span class="line">            aUp.RdOff += cnt</span><br><span class="line">            self.jlink.JLINKARM_WriteU32(self.aUpAddr + <span class="number">4</span> * <span class="number">4</span>, aUp.RdOff)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            cnt = aUp.SizeOfBuffer - aUp.RdOff</span><br><span class="line">            <span class="built_in">str</span> = ctypes.create_string_buffer(cnt)</span><br><span class="line">            self.jlink.JLINKARM_ReadMem(ctypes.cast(aUp.pBuffer, ctypes.c_void_p).value + aUp.RdOff, cnt, <span class="built_in">str</span>)</span><br><span class="line">            aUp.RdOff = <span class="number">0</span></span><br><span class="line">            self.jlink.JLINKARM_WriteU32(self.aUpAddr + <span class="number">4</span> * <span class="number">4</span>, aUp.RdOff)</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> <span class="built_in">str</span>.raw</span><br></pre></td></tr></table></figure>
    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E8%B0%83%E8%AF%95%E5%B7%A5%E5%85%B7/" rel="tag"># 调试工具</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2022/04/16/Vivado2018.3%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/" rel="prev" title="Vivado2018.3安装教程">
      <i class="fa fa-chevron-left"></i> Vivado2018.3安装教程
    </a></div>
      <div class="post-nav-item">
    <a href="/2022/04/28/iir%E7%9B%B4%E6%8E%A5i%E5%9E%8B%E5%92%8C%E7%9B%B4%E6%8E%A5ii%E5%9E%8B%E6%BB%A4%E6%B3%A2%E5%99%A8/" rel="next" title="iir直接i型和直接ii型滤波器">
      iir直接i型和直接ii型滤波器 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%80%E3%80%81MCU%E7%AB%AF"><span class="nav-number">1.</span> <span class="nav-text">一、MCU端</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E7%94%B5%E8%84%91%E7%AB%AF"><span class="nav-number">2.</span> <span class="nav-text">二、电脑端</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
